#ifndef __NAUTILUS_NUTSTORE_H__
#define __NAUTILUS_NUTSTORE_H__

#include <glib.h>
#include <glib-object.h>

#include <libnautilus-extension/nautilus-info-provider.h>

#include "command-client.h"
#include "inputcmd-server.h"
#include "util.h"

G_BEGIN_DECLS

extern gboolean enable_file_info_in_progress_workaround;
extern gboolean enable_submenu_workaround;

/* Declarations for nutstore extension object.  
 * This object will be instantiated by nautilus.  
 * It implements the GInterfaces exported by libnautilus. 
 */

#define NAUTILUS_TYPE_NUTSTORE     (nautilus_nutstore_get_type ())
#define NAUTILUS_NUTSTORE(o)   (G_TYPE_CHECK_INSTANCE_CAST ((o), NAUTILUS_TYPE_NUTSTORE, NautilusNutstore))
#define NAUTILUS_IS_NUTSTORE(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), NAUTILUS_TYPE_NUTSTORE))

typedef struct _NautilusNutstore      NautilusNutstore;
typedef struct _NautilusNutstoreClass NautilusNutstoreClass;

struct _NautilusNutstore {
    /* parent class */
    GObject         parent_slot;

    /* hash table which map between filename and file object */
    GHashTable      *filename2obj;
    GHashTable      *obj2filename;

    /* nutstore root directories */
    GMutex          *ns_root_dirs_mutex;
    gchar           **ns_root_dirs;

    /* command client: send commands to daemon */
    NutstoreCommandClient       client;

    /* command server: receive reset command from daemon */
    NutstoreInputCommandServer  server;
};

struct _NautilusNutstoreClass {
    /* parent class */
    GObjectClass parent_slot;
};

/**
 * return the register type 
 */
GType nautilus_nutstore_get_type(void);
void  nautilus_nutstore_register_type(GTypeModule *module);

extern gboolean nutstore_use_nautilus_submenu_workaround;
extern gboolean nutstore_use_operation_in_progress_workaround;

G_END_DECLS

#endif
